package com.zrrd.learn.chapter06数组;

import java.util.Arrays;

/**
 * 调用函数
 *
 * @author wrn
 * @version 1.0
 * @date 2023/7/12 14:19
 */

public class Arrays01 {

    public static void main(String[] args) {

        int[] arr = new int[2000];

        Arrays.fill(arr,15);

        int[] a = {1,2};
        int[] a1 = Arrays.copyOf(a,5);

        System.out.println(Arrays.toString(a1));

        //引用类型 Arrays 数组帮助类
        int[] as = {23, 1, 3, 4, 5, 6, 7};

        float[] fs = {1, 2.3f, 4.1f, 5, 2, 1.09f, 8.23f};

        char[] names = {'张','刘','低','嗄','对','给','和','非'};

        //范围提制
        //Arrays.copyOf(数组，开始位置，结束位置)

        //复制
        int[] ints = Arrays.copyOf(as,3);

        //变成有序的
        Arrays.sort(as);
        Arrays.sort(fs);
        Arrays.sort(names);

        //输出
        System.out.println(Arrays.toString(as));
        System.out.println(Arrays.toString(fs));
        System.out.println(Arrays.toString(names));

    }

}
